package com.example.netty.inoutbound;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

public class MyServerInitilalizer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline()
//                .addLast(new MyByteToLongDecoder()) // 将要入站到 handler 的数据 进行解码 myByteoLongDecoder
                .addLast(new MyBateToLongDecoder2())
                // 出站的handler 进行编码
                .addLast(new MyLongToByteEncoder())
                // 自定义的 handler 处理业务逻辑
                .addLast(new MyServerHandler());
    }
}
